<!-- 运送详情 》 基本信息 -->

<template>
  <div class="DetailRepair-RepairBase">
    <MajorTitle title="基本信息">
      <ShowStatus v-if="one.hastenStatus > 1" v-bind="hastenProps" />
      <ShowStatus v-if="one.checkTimeoutFlag === 1" v-bind="superviseProps" />
      <ShowStatus v-bind="statusProps" />
    </MajorTitle>

    <EasyRow col3>
      <ShowText label="工单编号" bind="orderCode" />
      <ShowDict label="运送类型" bind="orderTypeId" :dict="CORE.DICT.deliver_type" />
      <ShowDict label="子类" bind="orderSubTypeId" :dict="CORE.DICT.task_sub_type" />
    </EasyRow>

    <EasyRow col3>
      <ShowText label="录单人">{{ createUser }}</ShowText>
      <ShowText label="所在位置" bind="areaName" />
      <ShowDict label="紧急程度" bind="urgency" :dict="CORE.DICT.URGENCY" />
    </EasyRow>

    <EasyRow col3>
      <ShowText label="提单人">{{ releaseUser }}</ShowText>
      <ShowTree :label="`所属${CORE.MAP.ORGAN}`" bind="organizationId" :dict="CORE.ORGAN.DICT" />
      <ShowDict label="工单来源" bind="orderSourceId" :dict="CORE.DICT.task_source" />
    </EasyRow>
  </div>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'
import RepairBase from '@admin/components/detail/DetailRepair/RepairBase'

// ============================== 导出组件 ============================== //

export default CORE.extend(RepairBase, {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'DeliverBase',

  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: {
    ...RepairBase.computed,

    /**
     * 状态字典
     */
    STATUS() {
      if (this.statusDict) return this.statusDict
      return (CORE.DICT.deliver_status || []).map(([, name, code, color]) => [code, name, '', color])
    },
  },
})
</script>
